home *** CD-ROM | disk | FTP | other *** search
/ Mac Magazin/MacEasy 14 / Mac Magazin and MacEasy Magazine CD - Issue 14.iso / Wissenschaft & Technik / Tools Plus 2.6.1 Evaluation Kit / Tools Plus 2.6.1 / User Manual / 02-Installing Tools Plus < prev    next >
INI File  |  1995-08-25  |  28KB  |  595 lines

  1. [Display using Monaco 9]
  2.  
  3.  
  4. 2  Installing Tools Plus
  5. ````````````````````````
  6.  
  7.  
  8.  
  9.  
  10.  
  11. Tools Plus Contents
  12. ```````````````````
  13. This Evaluation Kit comes with several varieties of Tools Plus. The one you use depends upon the compiler you are using (Metrowerks or Symantec) and the language you are programming in (C/C++ or Pascal).
  14.  
  15. Tools Plus software is made up of the following items:
  16.  
  17.    “ToolsPlus.Lib”   Library containing all Tools Plus routines 
  18.                      (CodeWarrior only)
  19.  
  20.    “ToolsPlus.Lib1”  Library containing Tools Plus routines (1 of 3)
  21.                      (Symantec compilers only)
  22.  
  23.    “ToolsPlus.Lib2”  Library containing Tools Plus routines (2 of 3)
  24.                      (Symantec compilers only)
  25.  
  26.    “ToolsPlus.Lib3”  Library containing Tools Plus routines (3 of 3)
  27.                      (Symantec compilers only)
  28.  
  29.    “ToolsPlus.h”     C header file for Tools Plus
  30.                      (C only)
  31.  
  32.    “ToolsPlus.c”     Source code for routines that must be compiled with
  33.                      your application.  When compiling for 680x0
  34.                      processors, these routines will be compiled
  35.                      according to your project’s preferences for
  36.                      processor (680x0) and/or math co-processor
  37.                      optimization.  When compiling for PowerPC, these
  38.                      routines are simply added to your project.
  39.                      (C only)
  40.  
  41.    “ToolsPlus.p”     Pascal interface file for Tools Plus
  42.                      (Pascal only)
  43.  
  44.    “Palette WDEF”    Optional resource file containing the WDEF resource
  45.                      (window definition) for floating palettes. Found in
  46.                      the “Optional Resources” folder.
  47.  
  48.    “Demos”           Folder containing a demo application and its source
  49.                      code
  50.  
  51.  
  52.  
  53.  
  54. Tools Plus Segments in Your Application (for 680x0 only)
  55. ````````````````````````````````````````````````````````
  56.   The segments containing the Tools Plus libraries and the ToolsPlus.c or ToolsPlus.p file will be constantly accessed while your application is running.  To reduce memory fragmentation, flag these segments as “Preload” and “Locked.”
  57.  
  58. Warning: Do not unload the segments containing Tools Plus libraries.
  59.          You can ensure that this doesn’t happen accidentally by
  60.          flagging them as not “Purgeable.”
  61.  
  62.  
  63.  
  64.  
  65. -----------------------------------------------------------------------
  66.  
  67.  
  68.  
  69.  
  70. Installing Tools Plus for THINK C
  71. `````````````````````````````````
  72.   Drag the ToolsPlus.Lib1, ToolsPlus.Lib2 and ToolsPlus.Lib3 libraries into the C Libraries folder, and ToolsPlus.h into the Mac #includes folder, or where ever you keep your other header files.  You can drag the ToolsPlus.c file into your C Libraries folder, even though it is not a library.  Keeping it with the ToolsPlus.Lib1, ToolsPlus.Lib2 and ToolsPlus.Lib3 libraries will help to remind you to include ToolsPlus.c in your project.
  73.  
  74.  
  75.  
  76.  
  77.  
  78. Adding Tools Plus to a THINK C Project
  79. ``````````````````````````````````````
  80.   To add Tools Plus to a THINK C project, first open your project, then use the Source menu’s Add… command to add the file ToolsPlus.Lib1, ToolsPlus.Lib2, ToolsPlus.Lib3, and ToolsPlus.c.
  81.  
  82.   Even though Tools Plus libraries can be located anywhere in your project, placing them at the top will organize it a little better.  Drag each of the libraries (ToolsPlus.Lib1, ToolsPlus.Lib2, and ToolsPlus.Lib3) into their own segment.  For convenience, drag ToolsPlus.c to the segment containing the last Tools Plus library.
  83.  
  84.   Note that all projects using Tools Plus must also include Symantec’s MacTraps library.
  85.  
  86.  
  87.  
  88.  
  89. -----------------------------------------------------------------------
  90.  
  91.  
  92.  
  93.  
  94. Installing Tools Plus for THINK Pascal
  95. ``````````````````````````````````````
  96.   Drag the ToolsPlus.Lib1, ToolsPlus.Lib2, and ToolsPlus.Lib3 libraries into the Libraries folder, and ToolsPlus.p into the Interface folder, or where ever you keep your other libraries and interfaces.
  97.  
  98.  
  99.  
  100.  
  101.  
  102. Adding Tools Plus to a THINK Pascal Project
  103. ```````````````````````````````````````````
  104.   To add Tools Plus to a THINK Pascal project, first open your project, then use the Project menu’s Add File command to add the files ToolsPlus.Lib1, ToolsPlus.Lib2, ToolsPlus.Lib3, and ToolsPlus.p to your project.
  105.  
  106.   Build Order…
  107.     Though libraries can be located anywhere in your build order,
  108.     placing them near the top (early in the compiling order) will
  109.     organize your project a little better.  The ToolsPlus.p interface
  110.     has to be compiled BEFORE your source code makes reference to it.
  111.     Placing it immediately below the libraries is a good, safe place
  112.  
  113.   By Segment…
  114.     Drag each of the Tools Plus libraries into their own segment.  For
  115.     convenience, drag the ToolsPlus.p interface file into the segment
  116.     containing the last Tools Plus library.
  117.  
  118.  
  119.  
  120.  
  121.  
  122. After Compiling
  123. ```````````````
  124.   So far, you’ve told THINK Pascal what files to use and the order in which they should be compiled.  When you compile your project the first time, THINK Pascal loads the specified libraries and integrates them into your project file, and it compiles source files (including ToolsPlus.p) and integrates them in your project file.  After your first compile, you’ll notice that THINK Pascal automatically added several items to your project file:
  125.       «ToolsPlus.Lib1:1»
  126.       «ToolsPlus.Lib2:1»
  127.       «ToolsPlus.Lib3:1»
  128.       «%_MethTables»
  129.       «%_SelProcs»
  130.       «%_Profiler»
  131.  
  132.   The «ToolsPlus.Lib1:1», «ToolsPlus.Lib2:1» and «ToolsPlus.Lib3:1» items contain the object code from the Tools Plus libraries, while «%_MethTables», «%_SelProcs» and «%_Profiler» items are part of THINK Pascal’s overhead (consult your THINK Pascal User Manual for details).
  133.  
  134.   Drag «ToolsPlus.Lib1:1» into the same segment as ToolsPlus.Lib1, «ToolsPlus.Lib2:1» into the same segment as ToolsPlus.Lib2, etc.
  135.  
  136.   Drag «%_MethTables», «%_SelProcs» and «%_Profiler» to any segment that won’t be unloaded while your application is running, such as the one containing the Runtime.Lib library.
  137.  
  138.   Even though the project window indicates that Segment 1 exceeds the 32k limit imposed on segments, the project will compile and run.  When you build your application, the smart linker will strip away unneeded code and significantly reduce the size of this segment.
  139.  
  140.  
  141. Note: Tools Plus does not have a dependency on the Runtime.Lib library.
  142.       Unless your application needs routines that are found only in the
  143.       full Runtime.Lib library, you can use the smaller µRuntime.Lib
  144.       library instead
  145.  
  146.  
  147.  
  148.  
  149. -----------------------------------------------------------------------
  150.  
  151.  
  152.  
  153.  
  154. Installing Tools Plus for CodeWarrior C (68K)
  155. `````````````````````````````````````````````
  156.   CodeWarrior is very flexible as to where it looks for files, so you can put Tools Plus libraries and support files just about anywhere on your disk as long as you define an access path to those files in your project’s preferences.  A good idea is to create a folder named “Tools Plus (68K) C/C++” (without the version number) in a convenient place on your hard disk.  When you create a new project, set an access path to this folder.  Your projects will automatically use newer versions of Tools Plus as long as you place the new files in this folder.
  157.  
  158.   Drag the ToolsPlus.Lib, ToolsPlus.c and ToolsPlus.h files into your Tools Plus folder.
  159.  
  160.  
  161.  
  162.  
  163.  
  164. Adding Tools Plus to a CodeWarrior C (68K) Project
  165. ``````````````````````````````````````````````````
  166.   To add Tools Plus to a CodeWarrior C project, first open your project, then use the Project menu’s Add Files… command to add the files ToolsPlus.Lib and ToolsPlus.c into your project.
  167.  
  168.   All projects using Tools Plus need to include the following Metrowerks libraries:
  169.     MacOS.Lib
  170.     ANSI (2i) C.68K.Lib  (or equivalent)
  171.     PASCAL.68K.Lib       (or equivalent)
  172.  
  173.   Note that the PASCAL.68K.Lib is a component of your CodeWarrior Pascal compiler.  In CodeWarrior 6, the file is named “P/RT.68K.lib”.
  174.  
  175.   Even though Tools Plus libraries can be located anywhere in your project, placing them at the top will organize it a little better.  Drag the ToolsPlus.Lib library into its own segment.  For convenience, drag the ToolsPlus.c file to the same segment containing the ToolsPlus.Lib library.
  176.  
  177. Warning: Applications using Tools Plus must use 2-byte integers.  Make
  178.          sure your “4-byte ints” option is turned off in to your
  179.          project’s preferences (processor options).  If your application
  180.          needs 4-byte integers, redeclare integers to be longs
  181.          throughout your code.
  182.  
  183.  
  184.  
  185. -----------------------------------------------------------------------
  186.  
  187.  
  188.  
  189.  
  190. Installing Tools Plus for CodeWarrior Pascal (68K)
  191. ``````````````````````````````````````````````````
  192.   CodeWarrior is very flexible as to where it looks for files, so you can put Tools Plus libraries and support files just about anywhere on your disk as long as you define an access path to those files in your project’s preferences.  A good idea is to create a folder named “Tools Plus (68K) Pascal” (without the version number) in a convenient place on your hard disk.  When you create a new project, set an access path to this folder.  Your projects will automatically use newer versions of Tools Plus as long as you place the new files in this folder.
  193.  
  194.   Drag the following files into your Tools Plus folder: ToolsPlus.Lib and ToolsPlus.p.
  195.  
  196.  
  197.  
  198.  
  199.  
  200. Adding Tools Plus to a CodeWarrior Pascal (68K) Project
  201. ```````````````````````````````````````````````````````
  202.   To add Tools Plus to a CodeWarrior Pascal project, first open your project, then use the Project menu’s Add Files… command to add the files ToolsPlus.Lib and ToolsPlus.p to your project.
  203.  
  204. All projects using Tools Plus need to include the following Metrowerks libraries:
  205.  
  206.   In CodeWarrior 7:
  207.     MacOS.lib
  208.     MacIntf(UPI).68K.lib  (or equivalent)
  209.     ANSI (2i) C.68K.Lib   (or equivalent)
  210.     PASCAL.68K.Lib
  211.  
  212.   In CodeWarrior 6:
  213.     Pascal/MacOS.Lib
  214.     MacIntf(UPI).68K.lib  (or equivalent)
  215.     P/ANSI.68K.Lib        (or equivalent)
  216.     P/RT.68K.lib
  217.  
  218.   Even though Tools Plus libraries can be located anywhere in your project, placing them at the top will organize it a little better.  Drag the ToolsPlus.Lib library into its own segment.  For convenience, drag the ToolsPlus.p file to the same segment containing the ToolsPlus.Lib library.
  219.  
  220.  
  221.  
  222.  
  223. -----------------------------------------------------------------------
  224.  
  225.  
  226.  
  227.  
  228. Installing Tools Plus for CodeWarrior C (PPC)
  229. `````````````````````````````````````````````
  230.   CodeWarrior is very flexible as to where it looks for files, so you can put Tools Plus libraries and support files just about anywhere on your disk as long as you define an access path to those files in your project’s preferences.  A good idea is to create a folder named “Tools Plus (PPC) C/C++” (without the version number) in a convenient place on your hard disk.  When you create a new project, set an access path to this folder.  Your projects will automatically use newer versions of Tools Plus as long as you place the new files in this folder.
  231.  
  232.   Drag the ToolsPlus.Lib, ToolsPlus.c and ToolsPlus.h files into your Tools Plus folder.
  233.  
  234.  
  235.  
  236.  
  237.  
  238. Adding Tools Plus to a CodeWarrior C (PPC) Project
  239. ``````````````````````````````````````````````````
  240.   To add Tools Plus to a CodeWarrior C project, first open your project, then use the Project menu’s Add Files… command to add the files ToolsPlus.Lib and ToolsPlus.c into your project.
  241.  
  242.   All projects using Tools Plus need to include the following Metrowerks libraries:
  243.     MWCRuntime.Lib
  244.     InterfaceLib
  245.     ANSI C.PPC.Lib     (or equivalent)
  246.     PASCAL.PPC.lib     (or equivalent)
  247.  
  248.   Note that the “PASCAL.PPC.lib” library is a component of your CodeWarrior Pascal compiler.  In CodeWarrior 6 it is named “P/Rt.PPC.lib”. 
  249.  
  250.   Even though the Tools Plus library can be located anywhere in your project, placing it at the top will organize the project a little better.  Add ToolsPlus.Lib and ToolsPlus.c to your project.  For convenience, you may want to keep these two files in the same group.
  251.  
  252.  
  253.  
  254.  
  255. -----------------------------------------------------------------------
  256.  
  257.  
  258.  
  259.  
  260. Installing Tools Plus for CodeWarrior Pascal (PPC)
  261. ``````````````````````````````````````````````````
  262.   CodeWarrior is very flexible as to where it looks for files, so you can put Tools Plus libraries and support files just about anywhere on your disk as long as you define an access path to those files in your project’s preferences.  A good idea is to create a folder named “Tools Plus (PPC) Pascal” (without the version number) in a convenient place on your hard disk.  When you create a new project, set an access path to this folder.  Your projects will automatically use newer versions of Tools Plus as long as you place the new files in this folder.
  263.  
  264.   Drag the following files into your Tools Plus folder: ToolsPlus.Lib and ToolsPlus.p.
  265.  
  266.  
  267.  
  268.  
  269.  
  270. Adding Tools Plus to a CodeWarrior Pascal (PPC) Project
  271. ```````````````````````````````````````````````````````
  272.   To add Tools Plus to a CodeWarrior Pascal project, first open your project, then use the Project menu’s Add Files… command to add the files ToolsPlus.Lib and ToolsPlus.p to your project.
  273.  
  274. All projects using Tools Plus need to include the following Metrowerks libraries:
  275.  
  276.   In CodeWarrior 7:
  277.     MWCRuntime.Lib
  278.     InterfaceLib
  279.     MacIntf(UPI).PPC.Lib    (or equivalent)
  280.     ANSI C.PPC.lib          (or equivalent)
  281.     PASCAL.PPC.lib
  282.  
  283.   In CodeWarrior 6:
  284.     MWPRuntime.Lib
  285.     InterfaceLib
  286.     MacIntf(UPI).PPC.Lib    (or equivalent)
  287.     P/ANSI.PPC.lib          (or equivalent)
  288.     P/Rt.PPC.lib
  289.  
  290.   Even though the Tools Plus library can be located anywhere in your project, placing it at the top will organize your project a little better.  Add ToolsPlus.Lib and ToolsPlus.p to your project.  For convenience, you may want to keep these two files in the same group.
  291.  
  292.  
  293.  
  294.  
  295. =======================================================================
  296.  
  297.  
  298.  
  299.  
  300. Compiling the THINK C Demo Application
  301. ``````````````````````````````````````
  302. The easiest way to compile the THINK C demo application included with Tools Plus is to have the following files in the same folder:
  303.     Demo.π
  304.     Demo.π.rsrc
  305.     Demo.c
  306.     ToolsPlus.Lib1
  307.     ToolsPlus.Lib2
  308.     ToolsPlus.Lib3
  309.     ToolsPlus.h
  310.     ToolsPlus.c
  311.     PascalStrHandles.c
  312. Double-click the Demo.π project file to launch THINK C, then run your project.
  313.  
  314.   Your project file keeps track of each file’s location as you add it to your project, so you may want to create a new project file after you have put all the Tools Plus libraries and related files in their permanent folders.  Create a new (empty) project named “Demo.π” in the same folder as “Demo.π.rsrc” and “PascalStrHandles.c”.  Add the following files to your new project:
  315.     Segment 1:   MacTraps
  316.                  MacTraps2
  317.     Segment 2:   ANSI
  318.     Segment 3:   ToolsPlus.Lib1
  319.     Segment 4:   ToolsPlus.Lib2
  320.     Segment 5:   ToolsPlus.Lib3
  321.                  ToolsPlus.c
  322.     Segment 6:   Demo.c
  323. You can now build your project and run your application.
  324.  
  325.  
  326. Note: Make sure you allocate sufficient memory to the debugger if you
  327.       are going to run the Tools Plus demo application with the debugger
  328.       on.  The Tools Plus demo was written as one large source file,
  329.       making it easier to compile and study, but making it hungry for
  330.       debugger memory.  Allocate at least 500K to the debugger.  If you
  331.       don’t have enough memory, turn the debugger off (Project menu,
  332.       deselect “Use Debugger”) when running the demo.
  333.         Your applications will likely be written in a more intelligent
  334.       fashion, abandoning one large source file in favor of several
  335.       smaller ones.
  336.  
  337.  
  338.  
  339. IMPORTANT! Errors when compiling the Demo…
  340. ``````````````````````````````````````````
  341.   At the time of this writing, Water’s Edge Software has made every effort to ensure that our demo application will compile successfully the first time. Unfortunately, Symantec C/C++ compilers have undergone a series of revisions and some inconsistencies have arisen between compiler versions. Fortunately, these differences are simple to resolve.
  342.  
  343.   If your compiler gives you an error that states “argument to function ‘x’ does not match prototype,” it indicates that Symantec has made a minor revision to that function’s prototype (in the error message, ‘x’ will be replaced by the function’s name). To correct this error, inspect the offending line in the source file, which is likely a line like:
  344.  
  345.     PenPat(&gray);
  346.  
  347. and revise it to match the prototype in the related header file. In the example above, the correction is as simple as changing the line to:
  348.  
  349.     PenPat(gray);        /* Remove ampersand (&) from the variable */
  350.  
  351.  
  352.   To date, all inconsistencies have been of this nature. We are sorry for the inconvenience these issues may cause you, and would like to offer our assistance if you have problems getting the demo compiled. See the “Technical Support” chapter for information on how to contact Water’s Edge Software for assistance.
  353.  
  354.  
  355.  
  356. -----------------------------------------------------------------------
  357.  
  358.  
  359.  
  360.  
  361. Compiling the THINK Pascal Demo Application
  362. ```````````````````````````````````````````
  363. The easiest way to compile the THINK Pascal demo application included with Tools Plus is to have the following files in the same folder:
  364.     Demo.π
  365.     Demo.π.rsrc
  366.     Demo.p
  367.     ToolsPlus.Lib1
  368.     ToolsPlus.Lib2
  369.     ToolsPlus.Lib3
  370.     ToolsPlus.p
  371. Double-click the Demo.π project file to launch THINK Pascal, then run your project.
  372.  
  373.   Your project file keeps track of each file’s location as you add it to your project, so you may want to create a new project file after you have put all the Tools Plus libraries and related files in their permanent folders.  Create a new project named “Demo.π” in the same folder as “Demo.π.rsrc”.  Add the following files to your new project:
  374.     Segment 1:   Runtime.Lib
  375.                  Interface.Lib
  376.     Segment 2:   ToolsPlus.Lib1
  377.     Segment 3:   ToolsPlus.Lib2
  378.     Segment 4:   ToolsPlus.Lib3
  379.                  ToolsPlus.p
  380.     Segment 5:   Sound.p
  381.                  Demo.p
  382. You can now build your project.  After the initial compile, you will notice THINK Pascal created some additional entries in your project file:
  383.     «ToolsPlus.Lib1:1»
  384.     «ToolsPlus.Lib2:1»
  385.     «ToolsPlus.Lib3:1»
  386.     «%_MethTables»
  387.     «%_SelProcs»
  388.     «%_Profiler»
  389.  
  390.   The «ToolsPlus.Lib1:1», «ToolsPlus.Lib2:1» and «ToolsPlus.Lib3:1» items contain the object code from the Tools Plus libraries, while «%_MethTables», «%_SelProcs» and «%_Profiler» items are part of THINK Pascal’s overhead (consult your THINK Pascal User Manual for details).
  391.  
  392.   Drag «ToolsPlus.Lib1:1» into the same segment as ToolsPlus.Lib1, «ToolsPlus.Lib2:1» into the same segment as ToolsPlus.Lib2, and «ToolsPlus.Lib3:1» into the same segment as ToolsPlus.Lib3.
  393.  
  394.   Drag «%_MethTables», «%_SelProcs» and «%_Profiler» to any segment that won’t be unloaded while your application is running, such as the one containing the Runtime.Lib library.
  395.  
  396.   Even though the project window indicates that Segment 1 exceeds the 32k limit imposed on segments, the project will compile and run.  When you build your application, the smart linker will strip away unneeded code and significantly reduce the size of this segment.
  397.  
  398.  
  399.  
  400.  
  401. -----------------------------------------------------------------------
  402.  
  403.  
  404.  
  405.  
  406. Compiling the CodeWarrior C (68K) Demo Application
  407. ``````````````````````````````````````````````````
  408. The easiest way to compile the CodeWarrior C demo application included with Tools Plus is to have the following files in the same folder:
  409.     Demo.µ
  410.     Demo.π.rsrc
  411.     Demo.c
  412.     ToolsPlus.Lib
  413.     ToolsPlus.h
  414.     ToolsPlus.c
  415.     PascalStrHandles.c
  416. Double-click the Demo.µ project file to launch CodeWarrior C/C++, then run your project.
  417.  
  418.   If you are creating a new project (instead of using the one included as part of Tools Plus), you first need to install Tools Plus in your project file as described earlier in this chapter.  Copy the files “Demo.µ”, “Demo.π.rsrc” and “PascalStrHandles.c” to the folder containing your project.  Add the following files to your new project:
  419.     Segment 1:   MacOS.Lib
  420.                  ANSI (2i) C.68K.Lib    (or equivalent)
  421.                  PASCAL.68K.Lib         (or equivalent)
  422.     Segment 2:   ToolsPlus.Lib
  423.                  ToolsPlus.c
  424.     Segment 3:   Demo.π.rsrc
  425.                  Demo.c
  426.  
  427. (Note that the PASCAL.68K.Lib is a component of your CodeWarrior Pascal compiler.  In CodeWarrior 6, the file is named “P/RT.68K.lib”.)
  428.  
  429.   You can now build your project and run your application.
  430.  
  431.  
  432.  
  433. -----------------------------------------------------------------------
  434.  
  435.  
  436.  
  437.  
  438. Compiling the CodeWarrior Pascal (68K) Demo Application
  439. ```````````````````````````````````````````````````````
  440. The easiest way to compile the CodeWarrior Pascal demo application included with Tools Plus is to have the following files in the same folder:
  441.     Demo.µ
  442.     Demo.π.rsrc
  443.     Demo.p
  444.     ToolsPlus.Lib
  445.     ToolsPlus.p
  446. Double-click the Demo.µ project file to launch CodeWarrior Pascal, then run your project.
  447.  
  448.   If you are creating a new project (instead of using the one included as part of Tools Plus), you first need to install Tools Plus in your project file as described earlier in this chapter.  Copy the files “Demo.µ” and “Demo.π.rsrc” to the folder containing your project.  Add the following files to your new project:
  449.  
  450.   In CodeWarrior 7:
  451.     Segment 1:   MacOS.lib
  452.                  PASCAL.68K.Lib
  453.                  MacIntf(UPI).68K.lib   (or equivalent interface)
  454.                  ANSI (2i) C.68K.Lib    (or equivalent)
  455.     Segment 2:   ToolsPlus.Lib
  456.                  ToolsPlus.p
  457.     Segment 3:   Demo.π.rsrc
  458.                  Demo.p
  459.  
  460.   In CodeWarrior 6:
  461.     Segment 1:   Pascal/MacOS.Lib
  462.                  P/RT.68K.lib
  463.                  MacIntf(UPI).68K.lib   (or equivalent interface)
  464.                  P/ANSI.68K.Lib         (or equivalent)
  465.     Segment 2:   ToolsPlus.Lib
  466.                  ToolsPlus.p
  467.     Segment 3:   Demo.π.rsrc
  468.                  Demo.p
  469.  
  470. You can now build your project and run your application.
  471.  
  472.  
  473.  
  474.  
  475. -----------------------------------------------------------------------
  476.  
  477.  
  478.  
  479.  
  480. Compiling the CodeWarrior C (PPC) Demo Application
  481. ``````````````````````````````````````````````````
  482. The easiest way to compile the CodeWarrior C demo application included with Tools Plus is to have the following files in the same folder:
  483.     Demo.µ
  484.     Demo.π.rsrc
  485.     Demo.c
  486.     ToolsPlus.Lib
  487.     ToolsPlus.h
  488.     ToolsPlus.c
  489.     PascalStrHandles.c
  490. Double-click the Demo.µ project file to launch CodeWarrior C/C++, then run your project.
  491.  
  492.   If you are creating a new project (instead of using the one included as part of Tools Plus), you first need to install Tools Plus in your project file as described earlier in this chapter.  Copy the files “Demo.µ”, “Demo.π.rsrc” and “PascalStrHandles.c” to the folder containing your project.  Add the following files to your new project:
  493.       Group 1:   MWCRuntime.Lib
  494.                  InterfaceLib
  495.                  ANSI C.PPC.Lib         (or equivalent)
  496.                  PASCAL.PPC.lib         (or equivalent)
  497.       Group 2:   ToolsPlus.Lib
  498.                  ToolsPlus.c
  499.       Group 3:   Demo.π.rsrc
  500.                  Demo.c
  501. (Note that the “PASCAL.PPC.lib” library is a component of your CodeWarrior Pascal compiler.  In CodeWarrior 6 it is named “P/Rt.PPC.lib”.)
  502.  
  503.   You can now build your project and run your application.
  504.  
  505.  
  506.  
  507. -----------------------------------------------------------------------
  508.  
  509.  
  510.  
  511.  
  512. Compiling the CodeWarrior Pascal (PPC) Demo Application
  513. ```````````````````````````````````````````````````````
  514. The easiest way to compile the CodeWarrior Pascal demo application included with Tools Plus is to have the following files in the same folder:
  515.     Demo.µ
  516.     Demo.π.rsrc
  517.     Demo.p
  518.     ToolsPlus.Lib
  519.     ToolsPlus.p
  520. Double-click the Demo.µ project file to launch CodeWarrior Pascal, then run your project.
  521.  
  522.   If you are creating a new project (instead of using the one included as part of Tools Plus), you first need to install Tools Plus in your project file as described earlier in this chapter.  Copy the files “Demo.µ” and “Demo.π.rsrc” to the folder containing your project.  Add the following files to your new project:
  523.  
  524.   In CodeWarrior 7:
  525.       Group 1:   MWCRuntime.Lib
  526.                  InterfaceLib
  527.                  MacIntf(UPI).PPC.Lib    (or equivalent interface)
  528.                  ANSI C.PPC.lib          (or equivalent)
  529.                  PASCAL.PPC.lib
  530.       Group 2:   ToolsPlus.Lib
  531.                  ToolsPlus.p
  532.       Group 3:   Demo.π.rsrc
  533.                  Demo.p
  534.  
  535.   In CodeWarrior 6:
  536.       Group 1:   MWPRuntime.Lib
  537.                  InterfaceLib
  538.                  MacIntf(UPI).PPC.Lib    (or equivalent interface)
  539.                  P/ANSI.PPC.lib          (or equivalent)
  540.                  P/Rt.PPC.lib
  541.       Group 2:   ToolsPlus.Lib
  542.                  ToolsPlus.p
  543.       Group 3:   Demo.π.rsrc
  544.                  Demo.p
  545.  
  546. You can now build your project and run your application.
  547.  
  548.  
  549.  
  550.  
  551. -----------------------------------------------------------------------
  552.  
  553. Errors when compiling the CodeWarrior demos (or applications):
  554. ``````````````````````````````````````````````````````````````
  555.   At the time of this writing, Water’s Edge Software has made every effort to ensure that our demo application will compile successfully the first time. Unfortunately, Apple (who produces the C/C++ headers and Pascal interfaces into the Macintosh’s toolbox) and Metrowerks development environments are undergoing a series of revisions. As a result, some inconsistencies may arise between compiler versions. Fortunately, these differences are simple to resolve.
  556.  
  557. Access Paths
  558. ````````````
  559.   When using Tools Plus for CodeWarrior C/C++ (680x0 or PowerMac), a Pascal runtime library is required. You may have to change the Access Path (in your project’s preferences) to locate the required file. This applies to the demo application as well as the project in the “starter files” folder.
  560.  
  561. File Names
  562. ``````````
  563.   Metrowerks occasionally changes the names of their libraries. If your demo project (or starter project) can’t locate a file, remove the problem file from your project then add the equivalent, correctly named file. An Access Path to the correctly named file will be created automatically if it is required.
  564.  
  565. Routine Names
  566. `````````````
  567.   At the time of this writing, Apple was still revising the routine and constants names in their universal interfaces. Your compiler or linker will find these inconsistencies and bring them to your attention. If the application you are compiling uses constants that have been renamed in the new universal interfaces, you can resolve this in one of two ways:
  568.  
  569. 1) Go through your source code and replace all occurrences of the old
  570.    constant with the new constant name
  571.  
  572. 2) Define the old constant in a C/C++ header or Pascal interface file
  573.  
  574.   If the application you are compiling uses routine names that have been renamed in the new universal interfaces, the linker will discover this and report it to you. You can resolve this in one of two ways:
  575.  
  576. 1) Go through your source code and replace all occurrences of the old
  577.    routine name with the new routine name
  578.  
  579. 2) “Map” the old routine name to the new routine name used in the newest
  580.    universal interfaces. If a Tools Plus library refers to a routine
  581.    that has been renamed in the new universal interfaces, define the old
  582.    routine (so that the Tools Plus library can find it), and have the
  583.    old routine call the new routine. The following example shows you how
  584.    to do this:
  585.  
  586.        function GetCtlValue (theControl: ControlRef): INTEGER;
  587.        begin
  588.          GetCtlValue := GetControlValue(theControl)
  589.        end;
  590.  
  591.    The above example illustrates how the old GetCtlValue routine is
  592.    mapped to the new GetControlValue routine found in the universal
  593.    interfaces. Make sure that you defile the old routine with identical
  594.    parameter names and types as the new routine.
  595.